package test.ui {
	import gear.core.Game;
	import gear.net.LibData;
	import gear.net.RESManager;
	import gear.net.SWFLoader;
	import gear.ui.cell.LabelSource;
	import gear.ui.controls.GComboBox;
	import gear.ui.data.GComboBoxData;

	import flash.events.Event;

	/**
	 * TestGComboBox 组合框测试
	 * 
	 * @author bright
	 * @version 20101010
	 */
	[SWF(width=500,height=400,backgroundColor=0x333333,frameRate=48)]
	public class TestGComboBox extends Game {
		override protected function startup() : void {
			RESManager.instance.add(new SWFLoader(new LibData("assets/ui.swf", "ui")));
			RESManager.instance.addEventListener(Event.COMPLETE, completeHandler);
			RESManager.instance.load();
		}

		private function completeHandler(event : Event) : void {
			addComboBox();
		}

		private function addComboBox() : void {
			var data : GComboBoxData = new GComboBoxData();
			data.x = 10;
			data.y = 10;
			var comboBox : GComboBox = new GComboBox(data);
			comboBox.model.source = [new LabelSource("item0"), new LabelSource("item1")];
			comboBox.selectionModel.index = 0;
			addChild(comboBox);
		}

		public function TestGComboBox() {
			super();
		}
	}
}
